home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / OUTLOOK.NL-NL / OUTLKLR.CAB / OUTLLIBR.DLL_1043 / HTML / PAYCAL_HTML.XSL < prev    next >
Extensible Markup Language  |  2006-11-13  |  68KB  |  1,664 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- _LocalBinding -->
  3. <xsl:stylesheet version="1.0"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:data="urn:data-section"
  6.     exclude-result-prefixes="data">
  7.  
  8. <!-- To figure out what some of the cryptic localization comments are, -->
  9. <!-- see http://offglobe/LocalBinding/ -->
  10.  
  11. <xsl:output method="html" encoding="UTF-8"/>
  12.  
  13. <!-- **************************************************************************************************************
  14.  
  15.     Some layout constants
  16.  
  17. *************************************************************************************************************** -->
  18.  
  19.  
  20. <xsl:variable name="efbFree" select="0"/>
  21. <xsl:variable name="efbTent" select="1"/>
  22. <xsl:variable name="efbBusy" select="2"/>
  23. <xsl:variable name="efbOof"  select="3"/>
  24. <xsl:variable name="efbOowh" select="9"/>
  25.     <!-- Keep this synced with CPayCalXSLTRenderer::FBSTATUS_OOWH in paycalinternal.h -->
  26.  
  27. <xsl:variable name="iMaxDatePick" select="6"/> <!-- Should be divisible by 2 -->
  28.  
  29. <xsl:variable name="iDatepickCellWidth" select="20"/>
  30. <xsl:variable name="iDatepickTableWidth" select="$iDatepickCellWidth * 9"/>
  31.  
  32. <xsl:variable name="iFbWidth" select="12"/>
  33. <xsl:variable name="iUpArrowWidth" select="17"/>
  34.  
  35. <xsl:variable name="iFbHeight" select="13"/>
  36.  
  37. <xsl:variable name="iOuterTableWidth" select="500"/>
  38.  
  39. <xsl:variable name="iOuterTablePadding" select="2"/>
  40.  
  41. <xsl:variable name="iScheduleHMarginOuter" select="20"/>
  42. <xsl:variable name="iScheduleHMarginInner" select="10"/>
  43. <xsl:variable name="iScheduleTimeWidth" select="150"/>
  44. <xsl:variable name="iScheduleSubjectWidth" select="$iOuterTableWidth - $iScheduleHMarginOuter - $iScheduleHMarginInner - $iFbWidth - $iScheduleTimeWidth"/>
  45.  
  46. <xsl:variable name="iEventHMarginOuter" select="20"/>
  47.  
  48. <xsl:variable name="iOngoingHMarginOuter" select="20"/>
  49.  
  50. <xsl:variable name="iDetailHMarginLeft" select="17"/>
  51. <xsl:variable name="iDetailNameWidth" select="90"/>
  52.     
  53. <xsl:variable name="iDetailHMarginInner" select="10"/>
  54. <xsl:variable name="iDetailValueWidth" select="$iOuterTableWidth - $iDetailHMarginLeft - $iDetailNameWidth - $iDetailHMarginInner"/>
  55.  
  56. <xsl:variable name="iLineHeight" select="10"/>
  57.  
  58.  
  59. <xsl:variable name="szFgColorScheduleOowh"        select="'#666666'"/>
  60. <xsl:variable name="szBgColorScheduleOowh"        select="'#F7F7F7'"/>
  61. <xsl:variable name="szFgColorScheduleAlldayOof"   select="'#990099'"/>
  62. <xsl:variable name="szBgColorScheduleAlldayOof"   select="'#FFF7FF'"/>
  63. <xsl:variable name="szFgColorScheduleAlldayBusy"  select="'#000099'"/>
  64. <xsl:variable name="szBgColorScheduleAlldayBusy"  select="'#F7F7FF'"/>
  65. <xsl:variable name="szFgColorScheduleDefault"     select="'#000000'"/>
  66. <xsl:variable name="szBgColorScheduleDefault"     select="'#FFFFFF'"/>
  67.  
  68. <xsl:variable name="szRandomSeed" select="/dataroot/env-params/random-seed"/>
  69. <xsl:variable name="fEventsLayout" select="/dataroot/user-params/email-layout = 'events'"/>
  70. <xsl:variable name="rgndLocfmts" select="/dataroot/locfmts/locfmt"/>
  71. <xsl:variable name="rgndDetailedAppts" select="/dataroot/appointments/appt[./has-details]"/>
  72. <xsl:variable name="fHidingOowh" select="boolean(/dataroot/user-params/hiding-non-wkghrs)"/>
  73. <xsl:variable name="fSuppressBold" select="boolean(/dataroot/env-params/suppress-bold)"/>
  74.  
  75. <xsl:variable name="fRtl" select="boolean(/dataroot/env-params/rtl-locale)"/>
  76. <xsl:variable name="szLtrOrRtl">
  77.     <xsl:choose>
  78.         <xsl:when test="$fRtl">rtl</xsl:when>
  79.         <xsl:otherwise>ltr</xsl:otherwise>
  80.     </xsl:choose>
  81. </xsl:variable>
  82.  
  83. <!-- O12:405933: setting dir=rtl doesn't reverse text alignment, so we need to do that manually -->
  84. <xsl:variable name="szBidiAlignLeft">
  85.     <xsl:choose>
  86.         <xsl:when test="$fRtl">right</xsl:when>
  87.         <xsl:otherwise>left</xsl:otherwise>
  88.     </xsl:choose>
  89. </xsl:variable>
  90.  
  91. <xsl:variable name="szBidiAlignRight">
  92.     <xsl:choose>
  93.         <xsl:when test="$fRtl">left</xsl:when>
  94.         <xsl:otherwise>right</xsl:otherwise>
  95.     </xsl:choose>
  96. </xsl:variable>
  97.  
  98. <xsl:variable name="szAllDay">
  99.     
  100.     Hele dag
  101. </xsl:variable>
  102.  
  103. <!-- **************************************************************************************************************
  104.  
  105.     <TABLE> Attribute Sets
  106.  
  107. *************************************************************************************************************** -->
  108. <xsl:attribute-set name="table-base">
  109.     <xsl:attribute name="align">center</xsl:attribute>
  110.     <xsl:attribute name="border">0</xsl:attribute>
  111.     <!--<xsl:attribute name="bordercolor">red</xsl:attribute>-->
  112.     <xsl:attribute name="cellpadding">0</xsl:attribute>
  113.     <xsl:attribute name="cellspacing">0</xsl:attribute>
  114.     <xsl:attribute name="style">border-collapse:collapse;border:none</xsl:attribute>
  115. </xsl:attribute-set>
  116.  
  117.             <xsl:attribute-set name="table-outer" use-attribute-sets="table-base">
  118.                 <xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
  119.             </xsl:attribute-set>
  120.  
  121.             <xsl:attribute-set name="table-outer-padded" use-attribute-sets="table-outer">
  122.                 <xsl:attribute name="cellpadding"><xsl:value-of select="$iOuterTablePadding"/></xsl:attribute>
  123.             </xsl:attribute-set>
  124.  
  125.             <xsl:attribute-set name="table-datepick" use-attribute-sets="table-base">
  126.                 <xsl:attribute name="width"><xsl:value-of select="$iDatepickTableWidth"/></xsl:attribute>
  127.             </xsl:attribute-set>
  128.  
  129.  
  130. <!-- **************************************************************************************************************
  131.  
  132.     <TD> Attribute Sets
  133.  
  134. *************************************************************************************************************** -->
  135. <xsl:attribute-set name="td-base-datepick">
  136.     <xsl:attribute name="width"><xsl:value-of select="$iDatepickCellWidth"/></xsl:attribute>
  137.     <xsl:attribute name="align">center</xsl:attribute>
  138. </xsl:attribute-set>
  139.  
  140.             <xsl:attribute-set name="td-datepick-dow" use-attribute-sets="td-base-datepick"/>
  141.  
  142.             <xsl:attribute-set name="td-datepick-date-in" use-attribute-sets="td-base-datepick"/>
  143.  
  144.             <xsl:attribute-set name="td-datepick-date-out" use-attribute-sets="td-base-datepick"/>
  145.  
  146.             <xsl:attribute-set name="td-datepick-date-hmargin" use-attribute-sets="td-base-datepick"/>
  147.  
  148. <xsl:attribute-set name="td-base-sectionbar">
  149.     <xsl:attribute name="bgcolor">#A5ADC5</xsl:attribute>
  150.     <xsl:attribute name="height">30</xsl:attribute>
  151. </xsl:attribute-set>
  152.  
  153.             <xsl:attribute-set name="td-schedule-month" use-attribute-sets="td-base-sectionbar"/>
  154.  
  155.             <xsl:attribute-set name="td-events-year" use-attribute-sets="td-base-sectionbar"/>
  156.  
  157.             <xsl:attribute-set name="td-ongoing-head" use-attribute-sets="td-base-sectionbar"/>
  158.  
  159.             <xsl:attribute-set name="td-details-head" use-attribute-sets="td-base-sectionbar"/>
  160.  
  161. <xsl:attribute-set name="td-events-subject">
  162.     <xsl:attribute name="align"><xsl:value-of select="$szBidiAlignLeft"/></xsl:attribute>
  163.     <xsl:attribute name="valign">top</xsl:attribute>
  164. </xsl:attribute-set>
  165.  
  166. <xsl:attribute-set name="td-events-time">
  167.     <xsl:attribute name="align"><xsl:value-of select="$szBidiAlignRight"/></xsl:attribute>
  168.     <xsl:attribute name="valign">top</xsl:attribute>
  169. </xsl:attribute-set>
  170.  
  171. <xsl:attribute-set name="td-ongoing-subject">
  172.     <xsl:attribute name="align"><xsl:value-of select="$szBidiAlignLeft"/></xsl:attribute>
  173.     <xsl:attribute name="valign">top</xsl:attribute>
  174. </xsl:attribute-set>
  175.  
  176. <xsl:attribute-set name="td-ongoing-recurrence">
  177.     <xsl:attribute name="align"><xsl:value-of select="$szBidiAlignRight"/></xsl:attribute>
  178.     <xsl:attribute name="valign">top</xsl:attribute>
  179. </xsl:attribute-set>
  180.  
  181. <xsl:attribute-set name="td-details-leftmargin">
  182.     <xsl:attribute name="width"><xsl:value-of select="$iDetailHMarginLeft"/></xsl:attribute>
  183. </xsl:attribute-set>
  184.  
  185. <xsl:attribute-set name="td-details-name">
  186.     <xsl:attribute name="width"><xsl:value-of select="$iDetailNameWidth"/></xsl:attribute>
  187.     <xsl:attribute name="align"><xsl:value-of select="$szBidiAlignRight"/></xsl:attribute>
  188.     <xsl:attribute name="valign">top</xsl:attribute>
  189. </xsl:attribute-set>
  190.  
  191. <xsl:attribute-set name="td-details-innermargin">
  192.     <xsl:attribute name="width"><xsl:value-of select="$iDetailHMarginInner"/></xsl:attribute>
  193. </xsl:attribute-set>
  194.  
  195. <xsl:attribute-set name="td-details-value">
  196.     <xsl:attribute name="width"><xsl:value-of select="$iDetailValueWidth"/></xsl:attribute>
  197.     <xsl:attribute name="align"><xsl:value-of select="$szBidiAlignLeft"/></xsl:attribute>
  198.     <xsl:attribute name="valign">top</xsl:attribute>
  199. </xsl:attribute-set>
  200.  
  201. <xsl:attribute-set name="td-details-value-noalign">
  202.     <xsl:attribute name="width"><xsl:value-of select="$iDetailValueWidth"/></xsl:attribute>
  203.     <xsl:attribute name="valign">top</xsl:attribute>
  204. </xsl:attribute-set>
  205.  
  206. <!-- **************************************************************************************************************
  207.  
  208.     <IMG> Attribute Sets
  209.  
  210. *************************************************************************************************************** -->
  211. <xsl:attribute-set name="img-uparrow">
  212.     <xsl:attribute name="src">cid:paycal_uparrow.gif</xsl:attribute>
  213.     <xsl:attribute name="width"><xsl:value-of select="$iUpArrowWidth"/></xsl:attribute>
  214.     <xsl:attribute name="height">17</xsl:attribute>
  215.     <xsl:attribute name="border">0</xsl:attribute>
  216. </xsl:attribute-set>
  217.  
  218. <xsl:attribute-set name="img-line-outer-thin">
  219.     <xsl:attribute name="src">cid:paycal_line_outer_thin.gif</xsl:attribute>
  220.     <xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
  221.     <xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
  222.     <xsl:attribute name="border">0</xsl:attribute>
  223. </xsl:attribute-set>
  224.  
  225. <xsl:attribute-set name="img-line-outer-thick">
  226.     <xsl:attribute name="src">cid:paycal_line_outer_thick.gif</xsl:attribute>
  227.     <xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
  228.     <xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
  229.     <xsl:attribute name="border">0</xsl:attribute>
  230. </xsl:attribute-set>
  231.  
  232. <xsl:attribute-set name="img-line-datepick">
  233.     <xsl:attribute name="src">cid:paycal_line_datepick.gif</xsl:attribute>
  234.     <xsl:attribute name="width"><xsl:value-of select="$iDatepickTableWidth"/></xsl:attribute>
  235.     <xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
  236.     <xsl:attribute name="border">0</xsl:attribute>
  237. </xsl:attribute-set>
  238.  
  239. <xsl:attribute-set name="img-line-datepick-ellipsis">
  240.     <xsl:attribute name="src">cid:paycal_line_datepick_ellipsis.gif</xsl:attribute>
  241.     <xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
  242.     <xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
  243.     <xsl:attribute name="border">0</xsl:attribute>
  244. </xsl:attribute-set>
  245.  
  246. <xsl:attribute-set name="img-line-event-separator">
  247.     <xsl:attribute name="src">cid:paycal_line_event_separator.gif</xsl:attribute>
  248.     <xsl:attribute name="width"><xsl:value-of select="$iOuterTableWidth"/></xsl:attribute>
  249.     <xsl:attribute name="height"><xsl:value-of select="$iLineHeight"/></xsl:attribute>
  250.     <xsl:attribute name="border">0</xsl:attribute>
  251. </xsl:attribute-set>
  252.  
  253.  
  254. <!-- **************************************************************************************************************
  255.  
  256.     <FONT> Attribute Sets
  257.  
  258. *************************************************************************************************************** -->
  259. <xsl:attribute-set name="font-base">
  260.     <xsl:attribute name="size">-1</xsl:attribute>
  261. </xsl:attribute-set>
  262.  
  263. <xsl:attribute-set name="font-base-blue" use-attribute-sets="font-base">
  264.     <xsl:attribute name="color">#31527B</xsl:attribute>
  265. </xsl:attribute-set>
  266.  
  267. <xsl:attribute-set name="font-base-gray" use-attribute-sets="font-base">
  268.     <xsl:attribute name="color">#999999</xsl:attribute>
  269. </xsl:attribute-set>
  270.  
  271. <xsl:attribute-set name="font-base-white" use-attribute-sets="font-base">
  272.     <xsl:attribute name="color">#FFFFFF</xsl:attribute>
  273. </xsl:attribute-set>
  274.  
  275.             <xsl:attribute-set name="font-user-message" use-attribute-sets="font-base">
  276.                 <xsl:attribute name="size">+0</xsl:attribute>
  277.             </xsl:attribute-set>
  278.             
  279.             <xsl:attribute-set name="font-head" use-attribute-sets="font-base-blue">
  280.                 <xsl:attribute name="size">+0</xsl:attribute>
  281.             </xsl:attribute-set>
  282.  
  283.             <xsl:attribute-set name="font-legend" use-attribute-sets="font-base-blue">
  284.                 <xsl:attribute name="size">-1</xsl:attribute>
  285.             </xsl:attribute-set>
  286.  
  287.             <xsl:attribute-set name="font-datepick-month" use-attribute-sets="font-base-blue">
  288.                 <xsl:attribute name="size">+0</xsl:attribute>
  289.             </xsl:attribute-set>
  290.  
  291.             <xsl:attribute-set name="font-datepick-dow" use-attribute-sets="font-base-blue"/>
  292.  
  293.             <xsl:attribute-set name="font-datepick-date-out" use-attribute-sets="font-base-gray"/>
  294.  
  295.             <xsl:attribute-set name="font-datepick-date-in-nolink" use-attribute-sets="font-base-gray"/>
  296.  
  297.             <xsl:attribute-set name="font-datepick-date-in-link" use-attribute-sets="font-base-blue"/>
  298.  
  299.             <xsl:attribute-set name="font-schedule-month" use-attribute-sets="font-base-white">
  300.                 <xsl:attribute name="size">+0</xsl:attribute>
  301.             </xsl:attribute-set>
  302.  
  303.             <xsl:attribute-set name="font-schedule-day" use-attribute-sets="font-base-blue">
  304.                 <xsl:attribute name="size">+0</xsl:attribute>
  305.             </xsl:attribute-set>
  306.  
  307.             <xsl:attribute-set name="font-schedule-text" use-attribute-sets="font-base"/>
  308.  
  309.             <xsl:attribute-set name="font-events-year" use-attribute-sets="font-base-white">
  310.                 <xsl:attribute name="size">+0</xsl:attribute>
  311.             </xsl:attribute-set>
  312.  
  313.             <xsl:attribute-set name="font-events-text" use-attribute-sets="font-base"/>
  314.  
  315.             <xsl:attribute-set name="font-events-disabled" use-attribute-sets="font-base-gray"/>
  316.  
  317.             <xsl:attribute-set name="font-ongoing-head" use-attribute-sets="font-base-white">
  318.                 <xsl:attribute name="size">+0</xsl:attribute>
  319.             </xsl:attribute-set>
  320.  
  321.             <xsl:attribute-set name="font-ongoing-text" use-attribute-sets="font-base"/>
  322.  
  323.             <xsl:attribute-set name="font-details-head" use-attribute-sets="font-base-white">
  324.                 <xsl:attribute name="size">+0</xsl:attribute>
  325.             </xsl:attribute-set>
  326.  
  327.             <xsl:attribute-set name="font-details-day" use-attribute-sets="font-base-blue">
  328.                 <xsl:attribute name="size">+0</xsl:attribute>
  329.             </xsl:attribute-set>
  330.  
  331.             <xsl:attribute-set name="font-details-text" use-attribute-sets="font-base"/>
  332.  
  333. <!-- **************************************************************************************************************
  334.  
  335.     main()
  336.  
  337. *************************************************************************************************************** -->
  338. <xsl:template match="/">
  339. <html dir="{$szLtrOrRtl}"><head><title>Title Irrelevant (Do not localize)</title></head>
  340. <body bgcolor="#FFFFFF" link="#31527B" vlink="#31527B" alink="#31527B">
  341.  
  342.     <xsl:variable name="ndHtmlBody">
  343.         <font xsl:use-attribute-sets="font-user-message"><br/><br/><br/></font>
  344.         <xsl:call-template name="WriteSectionHead"/>
  345.         <xsl:call-template name="WriteSectionDatepick"/>
  346.         <xsl:choose>
  347.             <xsl:when test="$fEventsLayout">
  348.                 <xsl:call-template name="WriteSectionEvents"/>
  349.             </xsl:when>
  350.             <xsl:otherwise>
  351.                 <xsl:call-template name="WriteSectionLegend"/>
  352.                 <xsl:call-template name="WriteSectionSchedule"/>
  353.             </xsl:otherwise>
  354.         </xsl:choose>
  355.         <xsl:call-template name="WriteSectionOngoingAppts"/>
  356.         <xsl:call-template name="WriteSectionDetails"/>
  357.     </xsl:variable>
  358.  
  359.     <xsl:choose>
  360.         <xsl:when test="$fSuppressBold">
  361.             <xsl:call-template name="WriteUnboldedHtml">
  362.                 <xsl:with-param name="ndBody" select="$ndHtmlBody"/>
  363.             </xsl:call-template>
  364.         </xsl:when>
  365.         <xsl:otherwise>
  366.             <xsl:copy-of select="$ndHtmlBody"/>
  367.         </xsl:otherwise>
  368.     </xsl:choose>
  369.  
  370. </body>
  371. </html>
  372. </xsl:template>
  373.  
  374.  
  375. <!-- **************************************************************************************************************
  376.  
  377.     WriteSectionHead()
  378.  
  379. *************************************************************************************************************** -->
  380. <xsl:template name="WriteSectionHead">
  381.     <xsl:variable name="rgndDays" select="/dataroot/calendar/year/month/week/day"/>
  382.  
  383.     <xsl:variable name="absStart" select="$rgndDays[position() = 1]/@abs"/>
  384.     <xsl:variable name="absEnd" select="$rgndDays[position() = count($rgndDays)]/@abs"/>
  385.  
  386.     <center><a name="top{$szRandomSeed}"><img xsl:use-attribute-sets="img-line-outer-thick"/></a></center>
  387.  
  388.     <table xsl:use-attribute-sets="table-outer">
  389.         <tr>
  390.             <td>  </td>
  391.             <td><font xsl:use-attribute-sets="font-head">
  392.                 <b><xsl:value-of select="/dataroot/user-params/calendar-name"/></b>
  393.  
  394.                 <xsl:if test="/dataroot/user-params/owner-email">
  395.                     <br/><xsl:value-of select="/dataroot/user-params/owner-email"/>
  396.                 </xsl:if>
  397.  
  398.                 <br/>
  399.                 <xsl:call-template name="WriteDateRange">
  400.                     <xsl:with-param name="szStart" select="$rgndLocfmts[@abs = $absStart]/@long"/>
  401.                     <xsl:with-param name="szEnd" select="$rgndLocfmts[@abs = $absEnd]/@long"/>
  402.                 </xsl:call-template>
  403.  
  404.                 <xsl:if test="/dataroot/env-params/tz-name">
  405.                     <br/>
  406.                     
  407.                     Tijdzone: <xsl:value-of select="/dataroot/env-params/tz-name"/>
  408.                 </xsl:if>
  409.  
  410.                 <xsl:if test="/dataroot/env-params/observes-dst">
  411.                     <br/>
  412.                     
  413.                     (Aangepast aan zomertijd)
  414.                 </xsl:if>
  415.             </font></td>
  416.         </tr>
  417.     </table>
  418.  
  419.     <center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
  420. </xsl:template>
  421.  
  422.  
  423. <!-- **************************************************************************************************************
  424.  
  425.     WriteSectionDatepick()
  426.  
  427. *************************************************************************************************************** -->
  428. <xsl:template name="WriteSectionDatepick">
  429.     <!-- We need to form a new node set, so that the month positions don't get messed up by the year groupings -->
  430.     <xsl:variable name="rgndMonths" select="/dataroot/calendar/year/month"/>
  431.  
  432.     <!-- We need a table to arrange the datepickers into two columns -->
  433.     <table xsl:use-attribute-sets="table-outer">
  434.         <xsl:for-each select="$rgndMonths">
  435.             <!-- Only write out at most $iMaxDatePick datepickers -->
  436.             <xsl:if test="(position() mod 2 = 1) and (position() < $iMaxDatePick)">
  437.                 <tr>
  438.                     <!-- If we have an odd number of datepickers, center the last one in its own row -->
  439.                     <xsl:choose>
  440.                         <xsl:when test="count(following::month[1]) > 0">
  441.                             <td width="50%" valign="top"><xsl:apply-templates select="current()" mode="ModeDatepick"/></td>
  442.                             <td width="50%" valign="top"><xsl:apply-templates select="following::month[1]" mode="ModeDatepick"/></td>
  443.                         </xsl:when>
  444.                         <xsl:otherwise>
  445.                             <td colspan="2" valign="top"><xsl:apply-templates select="current()" mode="ModeDatepick"/></td>
  446.                         </xsl:otherwise>
  447.                     </xsl:choose>
  448.                 </tr>
  449.             </xsl:if>
  450.         </xsl:for-each>
  451.     </table>
  452.  
  453.     <xsl:if test="count($rgndMonths) > $iMaxDatePick">
  454.         <xsl:variable name="absMonthStart" select="$rgndMonths[position() = count($rgndMonths)]/@start-abs"/>
  455.  
  456.         <table xsl:use-attribute-sets="table-outer">
  457.             <tr>
  458.                 <td align="center"><font xsl:use-attribute-sets="font-datepick-month"><b>
  459.                     
  460.                     ... tot <xsl:value-of select="$rgndLocfmts[@abs = $absMonthStart]/@month"/>
  461.                 </b></font></td>
  462.             </tr>
  463.             <tr>
  464.                 <td height="{$iLineHeight}"><img xsl:use-attribute-sets="img-line-datepick-ellipsis"/></td>
  465.             </tr>
  466.             <tr>
  467.                 <td> </td>
  468.             </tr>
  469.         </table>
  470.     </xsl:if>
  471.  
  472.  
  473.  
  474. </xsl:template>
  475.  
  476. <!-- **************************************************************************************************************
  477.  
  478.     WriteSectionLegend()
  479.  
  480. *************************************************************************************************************** -->
  481. <xsl:template name="WriteSectionLegend">
  482.     <table xsl:use-attribute-sets="table-outer">
  483.         <tr>
  484.             <xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbBusy"/></xsl:call-template>
  485.             <xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbTent"/></xsl:call-template>
  486.             <xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbOof"/></xsl:call-template>
  487.             <xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbFree"/></xsl:call-template>
  488.             <xsl:call-template name="WriteLegendCell"><xsl:with-param name="efbNum" select="$efbOowh"/></xsl:call-template>
  489.         </tr>
  490.     </table>
  491. </xsl:template>
  492.  
  493. <!-- **************************************************************************************************************
  494.  
  495.     WriteSectionSchedule()
  496.  
  497. *************************************************************************************************************** -->
  498. <xsl:template name="WriteSectionSchedule">
  499.  
  500.     <xsl:for-each select="/dataroot/calendar/year/month">
  501.  
  502.         <!-- Month header -->
  503.         <table xsl:use-attribute-sets="table-outer">
  504.             <tr>
  505.                 <td> </td>
  506.             </tr>
  507.             <tr>
  508.                 <td xsl:use-attribute-sets="td-schedule-month"><font xsl:use-attribute-sets="font-schedule-month"><b>
  509.                      <xsl:value-of select="$rgndLocfmts[@abs = current()/@start-abs]/@month"/>
  510.                 </b></font></td>
  511.             </tr>
  512.         </table>
  513.         <center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
  514.  
  515.         <xsl:for-each select="week/day">
  516.             <xsl:apply-templates select="current()" mode="ModeSchedule"/>
  517.         </xsl:for-each>
  518.     </xsl:for-each>
  519.  
  520. </xsl:template>
  521.  
  522. <!-- **************************************************************************************************************
  523.  
  524.     WriteSectionEvents()
  525.  
  526. *************************************************************************************************************** -->
  527. <xsl:template name="WriteSectionEvents">
  528.  
  529.     <!-- Stick a separator at the top -->
  530.     <center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
  531.  
  532.     <table xsl:use-attribute-sets="table-outer-padded">
  533.         <xsl:apply-templates select="/dataroot/calendar/year" mode="ModeEvents"/>
  534.     </table>
  535. </xsl:template>
  536.  
  537. <!-- **************************************************************************************************************
  538.  
  539.     WriteSectionOngoing()
  540.  
  541. *************************************************************************************************************** -->
  542. <xsl:template name="WriteSectionOngoingAppts">
  543.     <xsl:variable name="rgndOngoingAppts" select="/dataroot/ongoing-appts/ongoing-ref"/>
  544.  
  545.     <!-- Only write out an ongoing appts section if there are ongoing appts -->
  546.     <xsl:if test="count($rgndOngoingAppts) > 0">
  547.         <!-- Ongoing appts header -->
  548.         <table xsl:use-attribute-sets="table-outer">
  549.             <tr>
  550.                 <td> </td>
  551.             </tr>
  552.             <tr>
  553.                 <td xsl:use-attribute-sets="td-ongoing-head"><font xsl:use-attribute-sets="font-ongoing-head"><b>
  554.                      
  555.                     
  556.                     Doorlopende afspraken
  557.                 </b></font></td>
  558.             </tr>
  559.         </table>
  560.         <center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
  561.  
  562.         <!-- Write out the data -->
  563.         <table xsl:use-attribute-sets="table-outer">
  564.             <!-- Group the ongoing appointments by recgroup -->
  565.             <xsl:for-each select="/dataroot/env-params/recgroup-data/recgroup">
  566.                 <xsl:variable name="iRecGroup" select="@num"/>
  567.                 <xsl:for-each select="$rgndOngoingAppts[@recgroup = $iRecGroup]">
  568.                     <xsl:variable name="iApptId" select="@id"/>
  569.                     <!-- Write out the row -->
  570.                     <xsl:call-template name="WriteOngoingRow">
  571.                         <xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = $iApptId]"/>
  572.                     </xsl:call-template>
  573.                 </xsl:for-each>
  574.             </xsl:for-each>
  575.         </table>
  576.     </xsl:if>
  577. </xsl:template>
  578.  
  579. <!-- **************************************************************************************************************
  580.  
  581.     WriteSectionDetails()
  582.  
  583. *************************************************************************************************************** -->
  584. <xsl:template name="WriteSectionDetails">
  585.  
  586.     <!-- Only write out a details section if there are appointments with details there -->
  587.     <xsl:if test="count($rgndDetailedAppts) > 0">
  588.         <!-- Details header -->
  589.         <table xsl:use-attribute-sets="table-outer">
  590.             <tr>
  591.                 <td> </td>
  592.             </tr>
  593.             <tr>
  594.                 <td xsl:use-attribute-sets="td-details-head"><font xsl:use-attribute-sets="font-details-head"><b>
  595.                      
  596.                     
  597.                     Details
  598.                 </b></font></td>
  599.             </tr>
  600.         </table>
  601.  
  602.         <xsl:apply-templates select="$rgndDetailedAppts" mode="ModeDetails"/>
  603.  
  604.  
  605.         <center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
  606.     </xsl:if>
  607. </xsl:template>
  608.  
  609. <!-- **************************************************************************************************************
  610.  
  611.     WriteLegendCell()
  612.  
  613. *************************************************************************************************************** -->
  614. <xsl:template name="WriteLegendCell">
  615.     <xsl:param name="efbNum"/>
  616.  
  617.     <td width="{$iFbWidth}" height="{$iFbHeight}">
  618.         <xsl:call-template name="WriteFbImage">
  619.             <xsl:with-param name="efbNum" select="$efbNum"/>
  620.         </xsl:call-template>
  621.     </td>
  622.     <td align="{$szBidiAlignLeft}" valign="center" height="{$iFbHeight}"><font xsl:use-attribute-sets="font-legend">
  623.          <xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=$efbNum]"/>
  624.     </font></td>
  625. </xsl:template>
  626.  
  627. <!-- **************************************************************************************************************
  628.  
  629.     WriteDatepickDowCell()
  630.  
  631. *************************************************************************************************************** -->
  632. <xsl:template name="WriteDatepickDowCell">
  633.     <xsl:param name="iCol"/>
  634.  
  635.     <td xsl:use-attribute-sets="td-datepick-dow"><font xsl:use-attribute-sets="font-datepick-dow">
  636.         <xsl:value-of select="/dataroot/env-params/dow-data/dow[@num=(/dataroot/env-params/first-dow + $iCol) mod 7]/@one-char"/>
  637.     </font></td>
  638.  
  639. </xsl:template>
  640.  
  641. <!-- **************************************************************************************************************
  642.  
  643.     template<month>(ModeDatepick)
  644.  
  645. *************************************************************************************************************** -->
  646. <xsl:template match="month" mode="ModeDatepick">
  647.  
  648.     <!-- Get the column offset of the first day of month (adjust day of weeks) -->
  649.     <xsl:variable name="iDowAdjust" select="(@start-dow - /dataroot/env-params/first-dow + 7) mod 7"/>
  650.  
  651.     <table xsl:use-attribute-sets="table-datepick">
  652.         <tr>
  653.             <td height="20" colspan="9" align="center"><font xsl:use-attribute-sets="font-datepick-month"><b>
  654.                 <xsl:value-of select="$rgndLocfmts[@abs = current()/@start-abs]/@month"/>
  655.             </b></font></td>
  656.         </tr>
  657.         <tr>
  658.             <td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
  659.             <xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="0"/></xsl:call-template>
  660.             <xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="1"/></xsl:call-template>
  661.             <xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="2"/></xsl:call-template>
  662.             <xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="3"/></xsl:call-template>
  663.             <xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="4"/></xsl:call-template>
  664.             <xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="5"/></xsl:call-template>
  665.             <xsl:call-template name="WriteDatepickDowCell"><xsl:with-param name="iCol" select="6"/></xsl:call-template>
  666.             <td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
  667.         </tr>
  668.         <tr>
  669.             <td colspan="9" height="{$iLineHeight}"><img xsl:use-attribute-sets="img-line-datepick"/></td>
  670.         </tr>
  671.  
  672.         <xsl:call-template name="WriteDatepickWeekAndRecurse">
  673.             <xsl:with-param name="iDayOfFirstCol" select="1 - $iDowAdjust"/>
  674.         </xsl:call-template>
  675.  
  676.         <tr>
  677.             <td colspan="9"> </td>
  678.         </tr>
  679.     </table>
  680. </xsl:template>
  681.  
  682. <!-- **************************************************************************************************************
  683.  
  684.     WriteDatepickWeekAndRecurse
  685.  
  686. *************************************************************************************************************** -->
  687. <xsl:template name="WriteDatepickWeekAndRecurse">
  688.     <xsl:param name="iDayOfFirstCol"/>
  689.  
  690.     <xsl:if test="$iDayOfFirstCol <= @days">
  691.         <tr>
  692.             <td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
  693.             <xsl:call-template name="WriteDatepickDayAndRecurse">
  694.                 <xsl:with-param name="iDay" select="$iDayOfFirstCol"/>
  695.                 <xsl:with-param name="iLastDay" select="$iDayOfFirstCol + 6"/>
  696.             </xsl:call-template>
  697.             <td xsl:use-attribute-sets="td-datepick-date-hmargin"> </td>
  698.         </tr>
  699.         <xsl:call-template name="WriteDatepickWeekAndRecurse">
  700.             <xsl:with-param name="iDayOfFirstCol" select="$iDayOfFirstCol + 7"/>
  701.         </xsl:call-template>
  702.     </xsl:if>
  703. </xsl:template>
  704.  
  705. <!-- **************************************************************************************************************
  706.  
  707.     WriteDatepickDayAndRecurse
  708.  
  709. *************************************************************************************************************** -->
  710. <xsl:template name="WriteDatepickDayAndRecurse">
  711.     <xsl:param name="iDay"/>
  712.     <xsl:param name="iLastDay"/>
  713.  
  714.     <xsl:if test="$iDay <= $iLastDay">
  715.  
  716.         <xsl:variable name="iDayAbs" select="$iDay - 1 + @start-abs"/>
  717.  
  718.         <xsl:variable name="fInMonth" select="$iDay >= 1 and $iDay <= @days"/>
  719.         <xsl:variable name="ndDay" select=".//day[@abs=$iDayAbs]"/>
  720.         <xsl:variable name="fInRange" select="$fInMonth and boolean($ndDay)"/>
  721.  
  722.         <xsl:variable name="fLink" select="$fInRange and (not($fEventsLayout) or boolean($ndDay/appt-ref[@first-ref]))"/>
  723.  
  724.         <!-- O12:256349 When a day contains nothing but continuations of multi-day events, link to the last multi-day event. -->
  725.         <xsl:variable name="ndFirstRef" select="$ndDay/appt-ref[position() = last()]"/>
  726.         <xsl:variable name="fLinkAlt" select="$fLink or ($fInRange and boolean($ndFirstRef))"/>
  727.  
  728.         <xsl:choose>
  729.             <xsl:when test="$fInRange">
  730.                 <td xsl:use-attribute-sets="td-datepick-date-in">
  731.                     <xsl:choose>
  732.                         <xsl:when test="$fLink">
  733.                             <a href="#day{$szRandomSeed}_{$iDayAbs}">
  734.                                 <font xsl:use-attribute-sets="font-datepick-date-in-link"><b><xsl:value-of select="$iDay"/></b></font>
  735.                             </a>
  736.                         </xsl:when>
  737.                         <xsl:when test="$fLinkAlt">
  738.                             <xsl:variable name="iDayAbsAlt" select="/dataroot/appointments/appt[@id = $ndFirstRef/@id]/start/@abs"/>
  739.                             <a href="#day{$szRandomSeed}_{$iDayAbsAlt}">
  740.                                 <font xsl:use-attribute-sets="font-datepick-date-in-link"><b><xsl:value-of select="$iDay"/></b></font>
  741.                             </a>
  742.                         </xsl:when>
  743.                         <xsl:otherwise>
  744.                             <font xsl:use-attribute-sets="font-datepick-date-in-nolink"><b><xsl:value-of select="$iDay"/></b></font>
  745.                         </xsl:otherwise>
  746.                     </xsl:choose>
  747.                 </td>
  748.             </xsl:when>
  749.             <xsl:otherwise>
  750.                 <td xsl:use-attribute-sets="td-datepick-date-out">
  751.                     <xsl:choose>
  752.                         <xsl:when test="not($fInMonth)"> </xsl:when>
  753.                         <xsl:otherwise>
  754.                             <font xsl:use-attribute-sets="font-datepick-date-out"><xsl:value-of select="$iDay"/></font>
  755.                         </xsl:otherwise>
  756.                     </xsl:choose>
  757.                 </td>
  758.             </xsl:otherwise>
  759.         </xsl:choose>
  760.  
  761.         <xsl:call-template name="WriteDatepickDayAndRecurse">
  762.             <xsl:with-param name="iDay" select="$iDay + 1"/>
  763.             <xsl:with-param name="iLastDay" select="$iLastDay"/>
  764.         </xsl:call-template>
  765.     </xsl:if>
  766. </xsl:template>
  767.  
  768. <!-- **************************************************************************************************************
  769.  
  770.     template<day>(ModeSchedule)
  771.  
  772. *************************************************************************************************************** -->
  773. <xsl:template match="day" mode="ModeSchedule">
  774.  
  775.     <!-- Skip over runs of identical appointments (except the first appt of each run) -->
  776.     <xsl:if test="not(identical-days) or identical-days/@startabs = @abs">
  777.          <br/>
  778.         <!-- Day header -->
  779.         <table xsl:use-attribute-sets="table-outer-padded">
  780.             <tr>
  781.                 <td width="{$iScheduleHMarginOuter}" align="center">
  782.                     <a href="#top{$szRandomSeed}"><img xsl:use-attribute-sets="img-uparrow"/></a>
  783.                 </td>
  784.                 <td width="{$iOuterTableWidth - $iScheduleHMarginOuter}" colspan="4"><font xsl:use-attribute-sets="font-schedule-day"><b>
  785.                     <xsl:choose>
  786.                         <xsl:when test="not(identical-days)">
  787.                             <!-- In the non-identical days case, we just have one date and one bookmark -->
  788.                             <xsl:value-of select="$rgndLocfmts[@abs = current()/@abs]/@short"/>
  789.                             <a name="day{$szRandomSeed}_{@abs}"> </a>
  790.                         </xsl:when>
  791.                         <xsl:otherwise>
  792.                             <!-- In the identical days case, we have a range of dates, followed by a small number of bookmarks -->
  793.                             <xsl:variable name="absStartIdent" select="identical-days/@startabs"/>
  794.                             <xsl:variable name="absEndIdent" select="identical-days/@endabs"/>
  795.                             <xsl:variable name="rgndDays" select="/dataroot/calendar/year/month/week/day"/>
  796.  
  797.                             <xsl:call-template name="WriteDateRange">
  798.                                 <xsl:with-param name="szStart" select="$rgndLocfmts[@abs = $absStartIdent]/@short"/>
  799.                                 <xsl:with-param name="szEnd" select="$rgndLocfmts[@abs = $absEndIdent]/@short"/>
  800.                             </xsl:call-template>
  801.  
  802.                             <!-- Check out this super cool for-loop technique from http://lists.xml.org/archives/xml-dev/200203/msg00442.html -->
  803.                             <xsl:for-each select="$rgndDays[position() <= $absEndIdent + 1 - $absStartIdent]">
  804.                                 <xsl:variable name="absCurIdent" select="position() - 1 + $absStartIdent"/>
  805.                                 <a name="day{$szRandomSeed}_{$absCurIdent}"> </a>
  806.                             </xsl:for-each>
  807.  
  808.                         </xsl:otherwise>
  809.                     </xsl:choose>
  810.                 </b></font></td>
  811.             </tr>
  812.         </table>
  813.  
  814.         <!-- Schedule grid -->
  815.         <table xsl:use-attribute-sets="table-outer-padded">
  816.             <xsl:apply-templates select="appt-ref[@allday]|free-block[@allday]" mode="ModeSchedule"/>
  817.             <xsl:apply-templates select="appt-ref[not(@allday)]|free-block[not(@allday)]" mode="ModeSchedule"/>
  818.         </table>
  819.  
  820.         <!-- Terminating line -->
  821.         <center><img xsl:use-attribute-sets="img-line-outer-thin"/></center>
  822.  
  823.     </xsl:if>
  824.  
  825. </xsl:template>
  826.  
  827. <!-- **************************************************************************************************************
  828.  
  829.     template<day/appt-ref|day/free-block>(ModeSchedule)
  830.  
  831. *************************************************************************************************************** -->
  832. <xsl:template match="appt-ref|free-block" mode="ModeSchedule">
  833.     <xsl:choose>
  834.         <xsl:when test="local-name(.) = 'appt-ref'">
  835.             <xsl:call-template name="WriteScheduleRow">
  836.                 <xsl:with-param name="fApptRef" select="true()"/>
  837.                 <xsl:with-param name="ndDay" select=".."/>
  838.                 <xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = current()/@id]"/>
  839.                 <xsl:with-param name="fAllday" select="boolean(@allday)"/>
  840.                 <xsl:with-param name="fInWkgHrs" select="boolean(@wkghrs)"/>
  841.             </xsl:call-template>
  842.         </xsl:when>
  843.         <xsl:otherwise>
  844.             <xsl:call-template name="WriteScheduleRow">
  845.                 <xsl:with-param name="fApptRef" select="false()"/>
  846.                 <xsl:with-param name="ndDay" select=".."/>
  847.                 <xsl:with-param name="ndAppt" select="."/>
  848.                 <xsl:with-param name="fAllday" select="boolean(@allday)"/>
  849.                 <xsl:with-param name="fInWkgHrs" select="boolean(@wkghrs)"/>
  850.             </xsl:call-template>
  851.         </xsl:otherwise>
  852.     </xsl:choose>
  853. </xsl:template>
  854.  
  855. <!-- **************************************************************************************************************
  856.  
  857.     WriteScheduleRow()
  858.  
  859. *************************************************************************************************************** -->
  860. <xsl:template name="WriteScheduleRow">
  861.     <xsl:param name="fApptRef"/>
  862.     <xsl:param name="ndDay"/>
  863.     <xsl:param name="ndAppt"/>
  864.     <xsl:param name="fAllday"/>
  865.     <xsl:param name="fInWkgHrs"/>
  866.  
  867.     <!-- Adjust working hours to make allday appointments gray iff the day is not a workday -->
  868.     <xsl:variable name="szInWkgHrsAdjusted">
  869.         <xsl:choose>
  870.             <xsl:when test="not($fAllday)"><xsl:value-of select="boolean($fInWkgHrs)"/></xsl:when>
  871.             <xsl:otherwise><xsl:value-of select="boolean(/dataroot/env-params/dow-data/dow[@num = $ndDay/@dow]/@workday)"/></xsl:otherwise>
  872.         </xsl:choose>
  873.     </xsl:variable>
  874.  
  875.     <!-- Note the trickiness of booleans in XSL -->
  876.     <xsl:variable name="fInWkgHrsAdjusted" select="$szInWkgHrsAdjusted = 'true'"/>
  877.  
  878.     <!-- Free busy defaults to free -->
  879.     <xsl:variable name="efbNum">
  880.         <xsl:choose>
  881.             <xsl:when test="$fApptRef"><xsl:value-of select="$ndAppt/fbstatus"/></xsl:when>
  882.             <xsl:when test="$fHidingOowh and not($fInWkgHrsAdjusted)"><xsl:value-of select="$efbOowh"/></xsl:when>
  883.             <xsl:otherwise><xsl:value-of select="$efbFree"/></xsl:otherwise>
  884.         </xsl:choose>
  885.     </xsl:variable>
  886.  
  887.     <!-- For the image only: "Free" gets converted to "Outside of Working Hours" when outside of working hours -->
  888.     <xsl:variable name="efbNumForImage">
  889.         <xsl:choose>
  890.             <xsl:when test="not($fInWkgHrsAdjusted) and $efbNum = $efbFree"><xsl:value-of select="$efbOowh"/></xsl:when>
  891.             <xsl:otherwise><xsl:value-of select="$efbNum"/></xsl:otherwise>
  892.         </xsl:choose>
  893.     </xsl:variable>
  894.  
  895.     <!-- Pick the foreground color -->
  896.     <xsl:variable name="szFgColorSchedule">
  897.         <xsl:choose>
  898.             <xsl:when test="$efbNum = $efbOowh"><xsl:value-of select="$szFgColorScheduleOowh"/></xsl:when>
  899.             <xsl:when test="$efbNum = $efbBusy and $fAllday"><xsl:value-of select="$szFgColorScheduleAlldayBusy"/></xsl:when>
  900.             <xsl:when test="$efbNum = $efbOof and $fAllday"><xsl:value-of select="$szFgColorScheduleAlldayOof"/></xsl:when>
  901.             <xsl:otherwise><xsl:value-of select="$szFgColorScheduleDefault"/></xsl:otherwise>
  902.         </xsl:choose>
  903.     </xsl:variable>
  904.  
  905.     <!-- Pick the background color -->
  906.     <xsl:variable name="szBgColorSchedule">
  907.         <xsl:choose>
  908.             <xsl:when test="$efbNum = $efbBusy and $fAllday"><xsl:value-of select="$szBgColorScheduleAlldayBusy"/></xsl:when>
  909.             <xsl:when test="$efbNum = $efbOof and $fAllday"><xsl:value-of select="$szBgColorScheduleAlldayOof"/></xsl:when>
  910.             <xsl:when test="not($fInWkgHrsAdjusted)"><xsl:value-of select="$szBgColorScheduleOowh"/></xsl:when>
  911.             <xsl:otherwise><xsl:value-of select="$szBgColorScheduleDefault"/></xsl:otherwise>
  912.         </xsl:choose>
  913.     </xsl:variable>
  914.  
  915.     <!-- Some complex rules for expressing this time range -->
  916.     <xsl:variable name="szTime">
  917.         <xsl:choose>
  918.             <xsl:when test="$fAllday">
  919.                 <!-- Case 0) If the appointment covers this entire day -->
  920.                 <xsl:value-of select="$szAllDay"/>
  921.             </xsl:when>
  922.             <xsl:when test="($ndAppt/start/@abs < $ndDay/@abs)">
  923.                 <!-- Case 1) This is the tail end of a multi-day appointment which ends at an off-time -->
  924.                 <xsl:call-template name="WriteTimeRange">
  925.                     <xsl:with-param name="szStart">
  926.                         
  927.                         Begin van dag
  928.                     </xsl:with-param>
  929.                     <xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
  930.                 </xsl:call-template>
  931.             </xsl:when>
  932.             <xsl:when test="(substring($ndAppt/start/@local, 9, 4) = '0000')">
  933.                 <!-- Case 2) This is a single-day appointment which starts at midnight and ends at an off-time -->
  934.                 <xsl:choose>
  935.                     <xsl:when test="substring($ndAppt/end/@local, 9, 4) = '0000'">
  936.                         <!-- Interesting case when the start == end == midnight, and we don't want to say "Before 12:00 AM" -->
  937.                         <xsl:call-template name="WriteTimeRange">
  938.                             <xsl:with-param name="szStart" select="$ndAppt/end/@tmlocfmt"/>
  939.                             <xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
  940.                         </xsl:call-template>
  941.                     </xsl:when>
  942.                     <xsl:otherwise>
  943.                         
  944.                         Voor <xsl:value-of select="$ndAppt/end/@tmlocfmt"/>
  945.                     </xsl:otherwise>
  946.                 </xsl:choose>
  947.             </xsl:when>
  948.             <xsl:when test="$ndAppt/end/@abs = $ndDay/@abs + 1 and substring($ndAppt/end/@local, 9, 4) = '0000'">
  949.                 <!-- Case 3) This is a single-day appointment which starts at an off-time and ends at midnight -->
  950.                 
  951.                 Na <xsl:value-of select="$ndAppt/start/@tmlocfmt"/>
  952.             </xsl:when>
  953.             <xsl:when test="$ndAppt/end/@abs > $ndDay/@abs">
  954.                 <!-- Case 4) This is the front end of a multi-day appointment which starts at an off-time -->
  955.                 <xsl:call-template name="WriteTimeRange">
  956.                     <xsl:with-param name="szStart" select="$ndAppt/start/@tmlocfmt"/>
  957.                     <xsl:with-param name="szEnd">
  958.                         
  959.                         Einde van dag
  960.                     </xsl:with-param>
  961.                 </xsl:call-template>
  962.             </xsl:when>
  963.             <xsl:otherwise>
  964.                 <!-- Case 5) This is a single-day appointment whcih starts and ends at off-times -->
  965.                 <xsl:call-template name="WriteTimeRange">
  966.                     <xsl:with-param name="szStart" select="$ndAppt/start/@tmlocfmt"/>
  967.                     <xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
  968.                 </xsl:call-template>
  969.             </xsl:otherwise>
  970.         </xsl:choose>
  971.     </xsl:variable>
  972.  
  973.     <!-- If the subject isn't specified, default it to the free-busy status -->
  974.     <xsl:variable name="szSubject">
  975.         <xsl:choose>
  976.             <xsl:when test="$ndAppt/subject">
  977.                 <xsl:value-of select="$ndAppt/subject"/>
  978.             </xsl:when>
  979.             <xsl:otherwise>
  980.                 <xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=$efbNum]"/>
  981.             </xsl:otherwise>
  982.         </xsl:choose>
  983.     </xsl:variable>
  984.  
  985.     <!-- Decide wheter or not to bold the text -->
  986.     <xsl:variable name="fBold" select="not($fApptRef) and $efbNum = $efbFree"/>
  987.  
  988.     <!-- Finally, we can render -->
  989.     <tr>
  990.         <td width="{$iScheduleHMarginOuter}"></td>
  991.         <td width="{$iFbWidth}" bgcolor="{$szBgColorSchedule}" valign="top">
  992.             <xsl:call-template name="WriteFbImage">
  993.                 <xsl:with-param name="efbNum" select="$efbNumForImage"/>
  994.             </xsl:call-template>
  995.         </td>
  996.         <td width="{$iScheduleTimeWidth}" align="{$szBidiAlignRight}" valign="top" bgcolor="{$szBgColorSchedule}"><font xsl:use-attribute-sets="font-schedule-text" color="{$szFgColorSchedule}">
  997.                 <xsl:choose>
  998.                     <xsl:when test="$fBold"><b><xsl:value-of select="$szTime"/></b></xsl:when>
  999.                     <xsl:otherwise><xsl:value-of select="$szTime"/></xsl:otherwise>
  1000.                 </xsl:choose>
  1001.         </font></td>
  1002.         <td width="{$iScheduleHMarginInner}" bgcolor="{$szBgColorSchedule}"></td>
  1003.         <td width="{$iScheduleSubjectWidth}" valign="top" bgcolor="{$szBgColorSchedule}"><font xsl:use-attribute-sets="font-schedule-text" color="{$szFgColorSchedule}">
  1004.                 <xsl:choose>
  1005.                     <xsl:when test="$fBold"><b><xsl:value-of select="$szSubject"/></b></xsl:when>
  1006.                     <xsl:when test="$ndAppt/has-details"><a href="#appt{$szRandomSeed}_{@id}"><xsl:value-of select="$szSubject"/></a></xsl:when>
  1007.                     <xsl:otherwise><xsl:value-of select="$szSubject"/></xsl:otherwise>
  1008.                 </xsl:choose>
  1009.                 <xsl:if test="$ndAppt/location">
  1010.                     <br/>
  1011.                     <xsl:value-of select="$ndAppt/location"/>
  1012.                 </xsl:if>
  1013.                 <xsl:if test="$ndAppt/organizer/name">
  1014.                     <br/>
  1015.                     <xsl:value-of select="$ndAppt/organizer/name"/>
  1016.                 </xsl:if>
  1017.         </font></td>
  1018.     </tr>
  1019.  
  1020. </xsl:template>
  1021.  
  1022. <!-- **************************************************************************************************************
  1023.  
  1024.     template<year>(ModeEvents)
  1025.  
  1026. *************************************************************************************************************** -->
  1027. <xsl:template match="year" mode="ModeEvents">
  1028.     <!-- Select all the days in this year which have appointments starting on them
  1029.              Jan 1 is special because all of the referenced appointments will be shown, even if they started
  1030.              before Jan 1 -->
  1031.     <xsl:variable name="rgndJan1" select="month/week/day[@num = 1 and ../../@num = 1 and boolean(appt-ref)]"/>
  1032.     <xsl:variable name="rgndDays" select="$rgndJan1|month/week/day[boolean(appt-ref[@first-ref])]"/>
  1033.     <xsl:variable name="iColSpan" select="6"/>
  1034.  
  1035.     <!-- Year header (only if there is at least 2 years) -->
  1036.     <xsl:if test="count(/dataroot/calendar/year) > 1">
  1037.         <tr>
  1038.             <td xsl:use-attribute-sets="td-events-year" colspan="{$iColSpan}"><font xsl:use-attribute-sets="font-events-year"><b>
  1039.                  <xsl:value-of select="@num"/>
  1040.             </b></font></td>
  1041.         </tr>
  1042.  
  1043.         <!-- Match a year header with a "No Events" explanation, if applicable -->
  1044.         <xsl:if test="count($rgndDays) = 0">
  1045.             <tr><td colspan="{$iColSpan}"> </td></tr>
  1046.             <tr>
  1047.                 <td colspan="{$iColSpan}"><font xsl:use-attribute-sets="font-events-disabled">
  1048.                           
  1049.                     
  1050.                     Geen gebeurtenissen
  1051.                 </font></td>
  1052.             </tr>
  1053.             <tr><td colspan="{$iColSpan}"> </td></tr>
  1054.         </xsl:if>
  1055.     </xsl:if>
  1056.  
  1057.     <!-- All of the year's data goes in one table -->
  1058.     <xsl:for-each select="$rgndDays">
  1059.         <!-- Day separator (but not for the first day) -->
  1060.         <xsl:if test="position() > 1">
  1061.             <tr>
  1062.                 <td height="{$iLineHeight}" align="center" colspan="{$iColSpan}">
  1063.                     <img xsl:use-attribute-sets="img-line-event-separator"/>
  1064.                 </td>
  1065.             </tr>
  1066.         </xsl:if>
  1067.  
  1068.         <!-- Write the events for the day -->
  1069.         <xsl:apply-templates select="current()" mode="ModeEvents"/>
  1070.  
  1071.     </xsl:for-each>
  1072.  
  1073.     <!-- Stick a separator at the bottom of each year -->
  1074.     <tr>
  1075.         <td height="{$iLineHeight}" colspan="{$iColSpan}"><img xsl:use-attribute-sets="img-line-outer-thin"/></td>
  1076.     </tr>
  1077.  
  1078. </xsl:template>
  1079.  
  1080.  
  1081. <!-- **************************************************************************************************************
  1082.  
  1083.     template<day>(ModeEvents)
  1084.  
  1085. *************************************************************************************************************** -->
  1086. <xsl:template match="day" mode="ModeEvents">
  1087.  
  1088.     <xsl:variable name="absDay" select="@abs"/>
  1089.     <xsl:variable name="ndDay" select="/dataroot/calendar/year/month/week/day[@abs = $absDay]"/>
  1090.     <xsl:variable name="iYear" select="$ndDay/../../../@num"/>
  1091.  
  1092.     <!-- Select the appointments we need to write out -->
  1093.     <xsl:variable name="fJan1" select="@num = 1 and ../../@num = 1"/>
  1094.     <xsl:variable name="rgndApptRefs" select="appt-ref[$fJan1]|appt-ref[@first-ref]"/>
  1095.  
  1096.     <xsl:variable name="rgndApptRefsAllDay" select="$rgndApptRefs[@allday]"/>
  1097.     <xsl:variable name="rgndApptRefsNotAllDay" select="$rgndApptRefs[not(@allday)]"/>
  1098.  
  1099.     <xsl:variable name="cndAllDay" select="count($rgndApptRefs[@allday])"/>
  1100.  
  1101.     <!-- Write out the all day events on this day -->
  1102.     <xsl:for-each select="$rgndApptRefsAllDay">
  1103.         <xsl:variable name="iId" select="./@id"/>
  1104.  
  1105.         <xsl:call-template name="WriteEventRow">
  1106.             <xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = $iId]"/>
  1107.             <xsl:with-param name="fForceStartDay" select="false()"/>
  1108.             <xsl:with-param name="fFirstRow" select="position() = 1"/>
  1109.             <xsl:with-param name="iYear" select="$iYear"/>
  1110.         </xsl:call-template>
  1111.     </xsl:for-each>
  1112.  
  1113.     <!-- Write out the non-all day events on this day -->
  1114.     <xsl:for-each select="$rgndApptRefsNotAllDay">
  1115.         <xsl:variable name="iId" select="./@id"/>
  1116.         <xsl:variable name="ndAppt" select="/dataroot/appointments/appt[@id = $iId]"/>
  1117.  
  1118.         <xsl:call-template name="WriteEventRow">
  1119.             <xsl:with-param name="ndAppt" select="/dataroot/appointments/appt[@id = $iId]"/>
  1120.             <xsl:with-param name="fForceStartDay" select="position() = 1"/>
  1121.             <xsl:with-param name="fFirstRow" select="position() = 1 and count($rgndApptRefsAllDay) = 0"/>
  1122.             <xsl:with-param name="iYear" select="$iYear"/>
  1123.         </xsl:call-template>
  1124.     </xsl:for-each>
  1125.  
  1126. </xsl:template>
  1127.  
  1128. <!-- **************************************************************************************************************
  1129.  
  1130.     WriteEventRow()
  1131.  
  1132. *************************************************************************************************************** -->
  1133. <xsl:template name="WriteEventRow">
  1134.     <xsl:param name="ndAppt"/>
  1135.     <xsl:param name="fForceStartDay"/>
  1136.     <xsl:param name="fFirstRow"/>
  1137.     <xsl:param name="iYear"/>
  1138.  
  1139.     <!-- If the subject isn't specified, default it to the free-busy status -->
  1140.     <xsl:variable name="szSubject">
  1141.         <xsl:choose>
  1142.             <xsl:when test="$ndAppt/subject">
  1143.                 <xsl:value-of select="$ndAppt/subject"/>
  1144.             </xsl:when>
  1145.             <xsl:otherwise>
  1146.                 <xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num = $ndAppt/fbstatus]"/>
  1147.             </xsl:otherwise>
  1148.         </xsl:choose>
  1149.     </xsl:variable>
  1150.  
  1151.     <!-- Figure out the time fields -->
  1152.     <xsl:variable name="f12to12" select="substring($ndAppt/start/@local, 9, 4) = '0000' and substring($ndAppt/end/@local, 9, 4) = '0000'"/>
  1153.     <xsl:variable name="iDaySpan" select="$ndAppt/end/@abs - $ndAppt/start/@abs + 1 - boolean($f12to12)"/>
  1154.  
  1155.     <xsl:variable name="absStart" select="$ndAppt/start/@abs"/>
  1156.     <xsl:variable name="absEnd" select="$ndAppt/end/@abs - boolean($f12to12)"/>
  1157.  
  1158.     <xsl:variable name="szStartDate">
  1159.         <xsl:if test="$iDaySpan > 1 or ($iDaySpan = 1 and $f12to12) or $fForceStartDay">
  1160.             <xsl:variable name="iStartYear" select="number(substring($ndAppt/start/@local, 1, 4))"/>
  1161.             <xsl:choose>
  1162.                 <xsl:when test="$iStartYear = $iYear">
  1163.                     <xsl:value-of select="$rgndLocfmts[@abs = $absStart]/@short"/>
  1164.                 </xsl:when>
  1165.                 <xsl:otherwise>
  1166.                     (<xsl:value-of select="$rgndLocfmts[@abs = $absStart]/@short-withyear"/>)
  1167.                 </xsl:otherwise>
  1168.             </xsl:choose>
  1169.         </xsl:if>
  1170.     </xsl:variable>
  1171.  
  1172.     <xsl:variable name="szTo">
  1173.         <xsl:if test="$iDaySpan > 1">
  1174.             
  1175.             t/m
  1176.         </xsl:if>
  1177.     </xsl:variable>
  1178.  
  1179.     <xsl:variable name="szEndDate">
  1180.         <xsl:variable name="iEndYear" select="number(substring($ndAppt/end/@local, 1, 4))"/>
  1181.         <xsl:if test="$iDaySpan > 1">
  1182.             <xsl:choose>
  1183.                 <xsl:when test="$iEndYear = $iYear">
  1184.                     <xsl:value-of select="$rgndLocfmts[@abs = $absEnd]/@short"/>
  1185.                 </xsl:when>
  1186.                 <xsl:otherwise>
  1187.                     (<xsl:value-of select="$rgndLocfmts[@abs = $absEnd]/@short-withyear"/>)
  1188.                 </xsl:otherwise>
  1189.             </xsl:choose>
  1190.         </xsl:if>
  1191.     </xsl:variable>
  1192.  
  1193.     <xsl:variable name="szTimeRange">
  1194.         <xsl:if test="not($f12to12)">
  1195.             <xsl:call-template name="WriteTimeRange">
  1196.                 <xsl:with-param name="szStart" select="$ndAppt/start/@tmlocfmt"/>
  1197.                 <xsl:with-param name="szEnd" select="$ndAppt/end/@tmlocfmt"/>
  1198.             </xsl:call-template>
  1199.         </xsl:if>
  1200.     </xsl:variable>
  1201.  
  1202.     <!-- Finally, write out the row -->
  1203.     <tr>
  1204.         <td width="{$iEventHMarginOuter + $iUpArrowWidth}" valign="top">
  1205.             <!-- Write out a bookmark for the day pointing to the first event -->
  1206.             <xsl:choose>
  1207.                 <xsl:when test="$fFirstRow">
  1208.                     <a name="day{$szRandomSeed}_{$absStart}"> </a><a href="#top{$szRandomSeed}"><img xsl:use-attribute-sets="img-uparrow"/></a>
  1209.                 </xsl:when>
  1210.                 <xsl:otherwise> </xsl:otherwise>
  1211.             </xsl:choose>
  1212.         </td>
  1213.         <td xsl:use-attribute-sets="td-events-subject"><font xsl:use-attribute-sets="font-events-text">
  1214.             <!-- Subject & location cell -->
  1215.             <xsl:choose>
  1216.                 <xsl:when test="$ndAppt/has-details">
  1217.                     <a href="#appt{$szRandomSeed}_{@id}"><b><xsl:value-of select="$szSubject"/></b></a>
  1218.                 </xsl:when>
  1219.                 <xsl:otherwise><b><xsl:value-of select="$szSubject"/></b></xsl:otherwise>
  1220.             </xsl:choose>
  1221.             <xsl:if test="$ndAppt/location">
  1222.                 <br/><xsl:value-of select="$ndAppt/location"/>
  1223.             </xsl:if>
  1224.         </font></td>
  1225.         <td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szStartDate"/></font></td>
  1226.         <td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szTo"/></font></td>
  1227.         <td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szEndDate"/></font></td>
  1228.         <td xsl:use-attribute-sets="td-events-time" nowrap=""><font xsl:use-attribute-sets="font-events-text"><xsl:value-of select="$szTimeRange"/></font></td>
  1229.     </tr>
  1230.  
  1231. </xsl:template>
  1232.  
  1233. <!-- **************************************************************************************************************
  1234.  
  1235.     WriteOngoingRow()
  1236.  
  1237. *************************************************************************************************************** -->
  1238. <xsl:template name="WriteOngoingRow">
  1239.     <xsl:param name="ndAppt"/>
  1240.  
  1241.     <!-- If the subject isn't specified, default it to the free-busy status -->
  1242.     <xsl:variable name="szSubject">
  1243.         <xsl:choose>
  1244.             <xsl:when test="$ndAppt/subject">
  1245.                 <xsl:value-of select="$ndAppt/subject"/>
  1246.             </xsl:when>
  1247.             <xsl:otherwise>
  1248.                 <xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=$ndAppt/fbstatus]"/>
  1249.             </xsl:otherwise>
  1250.         </xsl:choose>
  1251.     </xsl:variable>
  1252.  
  1253.     <!-- Write the row -->
  1254.     <tr>
  1255.         <td width="{$iOngoingHMarginOuter}" valign="top"> </td>
  1256.         <td xsl:use-attribute-sets="td-ongoing-subject"><font xsl:use-attribute-sets="font-ongoing-text">
  1257.             <xsl:choose>
  1258.                 <xsl:when test="$ndAppt/has-details">
  1259.                     <a href="#appt{$szRandomSeed}_{@id}"><b><xsl:value-of select="$szSubject"/></b></a>
  1260.                 </xsl:when>
  1261.                 <xsl:otherwise><b><xsl:value-of select="$szSubject"/></b></xsl:otherwise>
  1262.             </xsl:choose>
  1263.              <br/>
  1264.         </font></td>
  1265.         <td xsl:use-attribute-sets="td-ongoing-recurrence" valign="top"><font xsl:use-attribute-sets="font-ongoing-text">
  1266.             <xsl:value-of select="$ndAppt/recurrence"/>
  1267.              <br/>
  1268.         </font></td>
  1269.         <td width="{$iOngoingHMarginOuter}"> </td>
  1270.     </tr>
  1271.     <tr><td height="8" colspan="4"></td></tr>
  1272. </xsl:template>
  1273.  
  1274. <!-- **************************************************************************************************************
  1275.  
  1276.     template<appointments/appt>(ModeDetails)
  1277.  
  1278. *************************************************************************************************************** -->
  1279. <xsl:template match="appt" mode="ModeDetails">
  1280.  
  1281.     <xsl:variable name="absStart" select="start/@abs"/>
  1282.  
  1283.     <center><a name="appt{$szRandomSeed}_{@id}"><img xsl:use-attribute-sets="img-line-outer-thin"/></a></center>
  1284.  
  1285.     <!-- Only show the date header for the first detailed appointment of the day -->
  1286.     <xsl:variable name="rgndDetailedApptsToday" select="$rgndDetailedAppts[start/@abs = $absStart]"/>
  1287.     <xsl:if test="$rgndDetailedApptsToday[position() = 1]/@id = @id">
  1288.         <table xsl:use-attribute-sets="table-outer">
  1289.         <tr>
  1290.             <td><font xsl:use-attribute-sets="font-details-day">
  1291.                 <b><xsl:value-of select="$rgndLocfmts[@abs = $absStart]/@long"/></b>
  1292.             </font></td>
  1293.         </tr>
  1294.         </table>
  1295.     </xsl:if>
  1296.  
  1297.     <table xsl:use-attribute-sets="table-outer">
  1298.         <tr>
  1299.             <td xsl:use-attribute-sets="td-details-leftmargin"><a href="#day{$szRandomSeed}_{$absStart}"><img xsl:use-attribute-sets="img-uparrow"/></a></td>
  1300.             <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1301.                 
  1302.                 Tijd
  1303.             </b></font></td>
  1304.             <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1305.             <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1306.                 <!-- Differentiate date/time format if appointment is multi-day -->
  1307.                 <xsl:choose>
  1308.                     <xsl:when test="start/@abs + 1 = end/@abs and substring(start/@local, 9, 4) = '0000' and substring(end/@local, 9, 4) = '0000'">
  1309.                         <xsl:value-of select="$szAllDay"/>
  1310.                     </xsl:when>
  1311.                     <xsl:when test="start/@abs = end/@abs">
  1312.                         <xsl:call-template name="WriteTimeRange">
  1313.                             <xsl:with-param name="szStart" select="start/@tmlocfmt"/>
  1314.                             <xsl:with-param name="szEnd" select="end/@tmlocfmt"/>
  1315.                         </xsl:call-template>
  1316.                     </xsl:when>
  1317.                     <xsl:otherwise>
  1318.                         <xsl:call-template name="WriteTimeRange">
  1319.                             <xsl:with-param name="szStart" select="start/@dtlocfmt"/>
  1320.                             <xsl:with-param name="szEnd" select="end/@dtlocfmt"/>
  1321.                         </xsl:call-template>
  1322.                     </xsl:otherwise>
  1323.                 </xsl:choose>
  1324.             </font></td>
  1325.         </tr>
  1326.  
  1327.         <tr>
  1328.             <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1329.             <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1330.                 
  1331.                 Onderwerp
  1332.             </b></font></td>
  1333.             <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1334.             <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1335.                 <xsl:choose>
  1336.                     <xsl:when test="subject"><xsl:value-of select="subject"/></xsl:when>
  1337.                     <xsl:otherwise>
  1338.                         
  1339.                         (Geen onderwerp)
  1340.                     </xsl:otherwise>
  1341.                 </xsl:choose>
  1342.             </font></td>
  1343.         </tr>
  1344.  
  1345.         <xsl:if test="location">
  1346.             <tr>
  1347.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1348.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1349.                     
  1350.                     Locatie
  1351.                 </b></font></td>
  1352.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1353.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1354.                     <xsl:value-of select="location"/>
  1355.                 </font></td>
  1356.             </tr>
  1357.         </xsl:if>
  1358.  
  1359.         <xsl:if test="recurrence">
  1360.             <tr>
  1361.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1362.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1363.                     
  1364.                     Terugkeerpatroon
  1365.                 </b></font></td>
  1366.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1367.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1368.                     <xsl:value-of select="recurrence"/>
  1369.                 </font></td>
  1370.             </tr>
  1371.         </xsl:if>
  1372.  
  1373.         <xsl:if test="importance and importance != '1'">
  1374.             <tr>
  1375.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1376.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1377.                     
  1378.                     Urgentie
  1379.                 </b></font></td>
  1380.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1381.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1382.                     <xsl:value-of select="/dataroot/env-params/importance-data/importance[@num=current()/importance]"/>
  1383.                 </font></td>
  1384.             </tr>
  1385.         </xsl:if>
  1386.  
  1387.         <xsl:if test="attachment">
  1388.             <tr>
  1389.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1390.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1391.                     
  1392.                     Bijlagen
  1393.                 </b></font></td>
  1394.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1395.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1396.                     <xsl:for-each select="attachment">
  1397.                         <xsl:value-of select="."/><br/>
  1398.                     </xsl:for-each>
  1399.                 </font></td>
  1400.             </tr>
  1401.         </xsl:if>
  1402.  
  1403.         <xsl:if test="reminder">
  1404.             <tr>
  1405.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1406.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1407.                     
  1408.                     Herinnering
  1409.                 </b></font></td>
  1410.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1411.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1412.                     <xsl:value-of select="reminder"/>
  1413.                 </font></td>
  1414.             </tr>
  1415.         </xsl:if>
  1416.  
  1417.         <xsl:if test="fbstatus and not($fEventsLayout)">
  1418.             <tr>
  1419.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1420.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1421.                     
  1422.                     Tijd weergeven als
  1423.                 </b></font></td>
  1424.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1425.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1426.                     <xsl:value-of select="/dataroot/env-params/fbstatus-data/fbstatus[@num=current()/fbstatus]"/>
  1427.                 </font></td>
  1428.             </tr>
  1429.         </xsl:if>
  1430.  
  1431.         <xsl:if test="conftype">
  1432.             <tr>
  1433.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1434.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"> </td>
  1435.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1436.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1437.                     
  1438.                     Dit is een onlinevergadering met <xsl:value-of select="/dataroot/env-params/conftype-data/conftype[@num=current()/conftype]"/>
  1439.                     <br/> 
  1440.                 </font></td>
  1441.             </tr>
  1442.         </xsl:if>
  1443.  
  1444.         <xsl:if test="body">
  1445.             <xsl:variable name="szBodyLtrOrRtl">
  1446.                 <xsl:choose>
  1447.                     <xsl:when test="boolean(body/@rtl-strong)">rtl</xsl:when>
  1448.                     <xsl:otherwise>ltr</xsl:otherwise>
  1449.                 </xsl:choose>
  1450.             </xsl:variable>
  1451.             <tr>
  1452.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1453.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"> </td>
  1454.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1455.                 <td xsl:use-attribute-sets="td-details-value-noalign" dir="{$szBodyLtrOrRtl}"><font xsl:use-attribute-sets="font-details-text">
  1456.                     <xsl:copy-of select="body/child::node()|body/child::text()"/>
  1457.                 </font></td>
  1458.             </tr>
  1459.         </xsl:if>
  1460.  
  1461.         <xsl:if test="contacts">
  1462.             <tr>
  1463.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1464.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1465.                     
  1466.                     Contactpersonen
  1467.                 </b></font></td>
  1468.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1469.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1470.                     <xsl:value-of select="contacts"/>
  1471.                 </font></td>
  1472.             </tr>
  1473.         </xsl:if>
  1474.  
  1475.         <xsl:if test="categories">
  1476.             <tr>
  1477.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1478.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1479.                     
  1480.                     Categorie├½n
  1481.                 </b></font></td>
  1482.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1483.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1484.                     <xsl:value-of select="categories"/>
  1485.                 </font></td>
  1486.             </tr>
  1487.         </xsl:if>
  1488.  
  1489.         <xsl:if test="sensitivity and sensitivity != '0'">
  1490.             <tr>
  1491.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1492.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1493.                     
  1494.                     Gevoeligheid
  1495.                 </b></font></td>
  1496.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1497.                 <td xsl:use-attribute-sets="td-details-value"><font xsl:use-attribute-sets="font-details-text">
  1498.                     <xsl:value-of select="/dataroot/env-params/sensitivity-data/sensitivity[@num=current()/sensitivity]"/>
  1499.                 </font></td>
  1500.             </tr>
  1501.         </xsl:if>
  1502.  
  1503.         <xsl:if test="organizer|attendee">
  1504.             <tr>
  1505.                 <td xsl:use-attribute-sets="td-details-leftmargin"> </td>
  1506.                 <td xsl:use-attribute-sets="td-details-name" align="{$szBidiAlignRight}"><font xsl:use-attribute-sets="font-details-text"><b>
  1507.                     
  1508.                     Deelnemers
  1509.                 </b></font></td>
  1510.                 <td xsl:use-attribute-sets="td-details-innermargin"> </td>
  1511.                 <td xsl:use-attribute-sets="td-details-value">
  1512.                     <table width="100%">
  1513.                         <tr>
  1514.                             <td nowrap=""><font xsl:use-attribute-sets="font-details-text"><b>
  1515.                                 
  1516.                                 Naam <E-mail>
  1517.                             </b></font></td>
  1518.                             <td nowrap=""><font xsl:use-attribute-sets="font-details-text"><b>
  1519.                                 
  1520.                                 Aanwezigheid
  1521.                             </b></font></td>
  1522.                         </tr>
  1523.  
  1524.                         <xsl:apply-templates select="organizer" mode="ModeDetails"/>
  1525.                         <xsl:apply-templates select="attendee" mode="ModeDetails"/>
  1526.                     </table>
  1527.                 </td>
  1528.             </tr>
  1529.         </xsl:if>
  1530.  
  1531.     </table>
  1532.  
  1533. </xsl:template>
  1534.  
  1535. <!-- **************************************************************************************************************
  1536.  
  1537.     template<organizer|attendee>(ModeDetails)
  1538.  
  1539. *************************************************************************************************************** -->
  1540. <xsl:template match="organizer|attendee" mode="ModeDetails">
  1541.     <tr>
  1542.         <td valign="top"><font xsl:use-attribute-sets="font-details-text">
  1543.             <xsl:choose>
  1544.                 <xsl:when test="boolean(email)">
  1545.                     
  1546.                     <xsl:value-of select="name"/> <<xsl:value-of select="email"/>>
  1547.                 </xsl:when>
  1548.                 <xsl:otherwise>
  1549.                     
  1550.                     <xsl:value-of select="name"/>
  1551.                 </xsl:otherwise>
  1552.             </xsl:choose>
  1553.             <br/> 
  1554.         </font></td>
  1555.         <td valign="top" nowrap=""><font xsl:use-attribute-sets="font-details-text">
  1556.             <xsl:value-of select="/dataroot/env-params/attendeetype-data/attendeetype[@num = current()/@type]"/>
  1557.             <br/> 
  1558.         </font></td>
  1559.     </tr>
  1560. </xsl:template>
  1561.  
  1562. <!-- **************************************************************************************************************
  1563.  
  1564.     WriteFbImage()
  1565.  
  1566. *************************************************************************************************************** -->
  1567. <xsl:template name="WriteFbImage">
  1568.     <xsl:param name="efbNum"/>
  1569.  
  1570.     <xsl:variable name="srcShort">
  1571.         <xsl:choose>
  1572.             <xsl:when test="$efbNum = $efbFree">free</xsl:when>
  1573.             <xsl:when test="$efbNum = $efbTent">tent</xsl:when>
  1574.             <xsl:when test="$efbNum = $efbBusy">busy</xsl:when>
  1575.             <xsl:when test="$efbNum = $efbOof">oof</xsl:when>
  1576.             <xsl:when test="$efbNum = $efbOowh">oowh</xsl:when>
  1577.         </xsl:choose>
  1578.     </xsl:variable>
  1579.  
  1580.     <img width="{$iFbWidth}" height="{$iFbHeight}">
  1581.         <xsl:attribute name="src"><xsl:value-of select="concat('cid:paycal_', $srcShort, '.gif')"/></xsl:attribute>
  1582.     </img>
  1583. </xsl:template>
  1584.  
  1585. <!-- **************************************************************************************************************
  1586.  
  1587.     WriteTimeRange()
  1588.  
  1589. *************************************************************************************************************** -->
  1590. <xsl:template name="WriteTimeRange">
  1591.     <xsl:param name="szStart"/>
  1592.     <xsl:param name="szEnd"/>
  1593.  
  1594.     <xsl:choose>
  1595.         <xsl:when test="$szStart = $szEnd">
  1596.             
  1597.             Om <xsl:value-of select="$szStart"/>
  1598.         </xsl:when>
  1599.         <xsl:otherwise>
  1600.             
  1601.             <xsl:value-of select="$szStart"/> – <xsl:value-of select="$szEnd"/>
  1602.         </xsl:otherwise>
  1603.     </xsl:choose>
  1604. </xsl:template>
  1605.  
  1606.  
  1607.  
  1608. <!-- **************************************************************************************************************
  1609.  
  1610.     WriteDateRange()
  1611.  
  1612. *************************************************************************************************************** -->
  1613. <xsl:template name="WriteDateRange">
  1614.     <xsl:param name="szStart"/>
  1615.     <xsl:param name="szEnd"/>
  1616.  
  1617.     <xsl:choose>
  1618.         <xsl:when test="$szStart = $szEnd">
  1619.             
  1620.             Op <xsl:value-of select="$szStart"/>
  1621.         </xsl:when>
  1622.         <xsl:otherwise>
  1623.             
  1624.             <xsl:value-of select="$szStart"/> – <xsl:value-of select="$szEnd"/>
  1625.         </xsl:otherwise>
  1626.     </xsl:choose>
  1627. </xsl:template>
  1628.  
  1629. <!-- **************************************************************************************************************
  1630.  
  1631.     WriteUnboldedHtml()
  1632.  
  1633. *************************************************************************************************************** -->
  1634. <xsl:template name="WriteUnboldedHtml">
  1635.     <xsl:param name="ndBody"/>
  1636.  
  1637.     <!-- Iterate over each child -->
  1638.     <xsl:for-each select="$ndBody/child::node()|$ndBody/child::text()">
  1639.         <xsl:choose>
  1640.  
  1641.             <!-- Recursively strip <b> tags -->
  1642.             <xsl:when test="local-name(.) = 'b'">
  1643.                 <xsl:call-template name="WriteUnboldedHtml">
  1644.                     <xsl:with-param name="ndBody" select="."/>
  1645.                 </xsl:call-template>
  1646.             </xsl:when>
  1647.  
  1648.             <!-- Everything else comes in literally -->
  1649.             <xsl:otherwise>
  1650.                 <xsl:copy>
  1651.                     <xsl:copy-of select="@*"/>
  1652.                     <xsl:call-template name="WriteUnboldedHtml">
  1653.                         <xsl:with-param name="ndBody" select="."/>
  1654.                     </xsl:call-template>
  1655.                 </xsl:copy>
  1656.             </xsl:otherwise>
  1657.         </xsl:choose>
  1658.     </xsl:for-each>
  1659.  
  1660. </xsl:template>
  1661.  
  1662.  
  1663. </xsl:stylesheet>
  1664.